import cv2

# 读取第一张图像（原始图像）
img = cv2.imread("pika.png")
# 调整图像大小
img_resized = cv2.resize(img, (400, 400))
cv2.imshow("showing", img_resized)
cv2.waitKey(0)

# 读取第二张图像（圆形图像）
circle_img = cv2.imread("qiu.jpg")

# 调整圆形图像大小，以匹配第一张图像的大小
circle_img_resized = cv2.resize(circle_img, (400, 400))
cv2.imshow("circle_image", circle_img_resized)
cv2.waitKey(0)

"""执行与运算"""
result_and = cv2.bitwise_and(img_resized, circle_img_resized)
cv2.imshow("showing_and", result_and)
cv2.waitKey(0)

"""执行或运算"""
result_or = cv2.bitwise_or(img_resized, circle_img_resized)
cv2.imshow("showing_or", result_or)
cv2.waitKey(0)

"""执行非运算"""
result_not_1 = cv2.bitwise_not(img_resized)
cv2.imshow("showing_not_1", result_not_1)
cv2.waitKey(0)
result_not_2 = cv2.bitwise_not(circle_img_resized)
cv2.imshow("showing_not_2", result_not_2)
cv2.waitKey(0)
cv2.destroyAllWindows()

